#include "StdAfx.h"
#include "ModelViewFrameListener.h"

ModelViewFrameListener::ModelViewFrameListener(Ogre::RenderWindow* pOgreWin)
: GameFrameListener(pOgreWin), m_pAni(NULL)
{
}

ModelViewFrameListener::~ModelViewFrameListener(void)
{
}

bool ModelViewFrameListener::frameStarted(const Ogre::FrameEvent& evt)
{
	if(!GameFrameListener::frameStarted(evt))
		return false;
	if(m_pAni)
		m_pAni->addTime(evt.timeSinceLastFrame);
	return true;
}

void ModelViewFrameListener::setAnimationState(Ogre::AnimationState* pAni)
{ 
	if(m_pAni)
		m_pAni->setEnabled(false);
	m_pAni = pAni;
}